{template 'common/header'}
<div class="main">
    <ul class="nav nav-tabs">
        <li{if $_GPC['do'] == 'manage' || $_GPC['do'] == '' } class="active"{/if}><a href="{php echo $this->createWebUrl('manage');}">活动列表</a></li>
        <li{if $_GPC['do'] == 'post'} class="active"{/if}><a href="{php echo url('platform/reply/post',array('m'=>'eso_runman'));}">添加活动</a></li>
    </ul>
    <div class="panel panel-info">
        <div class="panel-heading">筛选</div>
        <div class="panel-body">
            <form action="./index.php" method="get" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="eso_runman" />
                <input type="hidden" name="do" value="manage" />
                <input type="hidden" name="rid" value="{$_GPC['rid']}" />
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
                    <div class="col-xs-12 col-sm-8 col-lg-9">
                        <input class="form-control" name="keywords" id="" type="text" value="{$_GPC['keywords']}">
                    </div>
                    <div class=" col-xs-12 col-sm-2 col-lg-2">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                    </div>
                </div>
                <div class="form-group">
                </div>
            </form>
        </div>

    </div>
    <div class="panel panel-default">
        <div class="panel-body table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th>活动名称</th>
                    <th style="width:150px;">参与/浏览人数</th>
                    <th>开始时间/结束时间</th>
                    <th style="width:120px;">状态</th>
                    <th style="width:210px;">操作</th>
                </tr>
                </thead>
                <tbody>
                {loop $list $row}
                <tr>
                    <td>{$row['title']} </td>
                    <td>{$row['join']} / {$row['view']} </td>
                    <td>{$row['starttime']} / {$row['endtime']}</td>
                    <td>{$row['status']}</td>
                    <td>
                        <div class="btn-group pull-right">
                        <a class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" href="{php echo $this->createWebUrl('managed',array('rid'=>$row['id']))}" title="管理"><i class="fa fa-cog"></i> 管理</a>
                        <a class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" href="{php echo url('platform/reply/post',array('m'=>'eso_runman','rid'=>$row['id']));}" title="编辑"><i class="fa fa-edit"></i> 编辑</a>
                        <a class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" href="#" onclick="drop_confirm('您确定要删除吗?', '{php echo $this->createWebUrl('delete',array('rid'=>$row['id']))}');" title="删除"><i class="fa fa-times"></i> 删除</a>
                        </div>
                    </td>
                </tr>
                {/loop}
                {if !$list}
                <tr>
                    <td colspan="5" style="text-align:center">
                        没有任何活动请先添加。
                    </td>
                </tr>
                {/if}
                </tbody>
            </table>
        </div>
    </div>
    {$pager}
</div>
<script type="text/javascript">
    $(function(){
        //
    });
    function drop_confirm(msg, url){
        if (confirm(msg)){
            window.location = url;
        }
    }
</script>

{template 'common/footer'}